import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import pojo.User;

/**
 * @author DJJ_F
 * @version 1.0
 * @date 2025/01/21
 * @description
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:spring.xml") // 指定xml文件的路径
public class Junit4 {
    @Autowired // 需要的类可以直接Autowired，而不用getBean
    private User user;
    @Test
    public void name() {
        System.out.println(user);
    }
}
